home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / RAND / UNSPLIT / text0580.txt < prev    next >
Encoding:
Text File  |  1997-02-06  |  6.3 KB  |  147 lines

  1. Anders Eriksson wrote:
  2. <Sounds brilliant.  Please start asap! :-) I belive noone else has even
  3. <made any plans for structure and stuff for the sound, so  you might very
  4. <well do all the layout and design as you think is good.
  5.  
  6. I allready started, and some definitions are ready... I will speak of them 
  7. later...
  8.  
  9. Douglas Little wrote:
  10. <This all makes sense, but you might want to think about priority decay, so
  11. <that samples which have previously been started reduce in priority as time
  12. <advances - ensuring that all or most samples are triggered, even if they
  13. <are never completed. Very important for spot effects which have a decaying
  14.  
  15. Priority decay is briliant, cant believe I missed that :-)
  16. Lets say you give a word of priority that decays and reaches zero at the 
  17. same time as the sample is finished!?!
  18. As for the input, lets have:
  19. * Sample Nr (Word)
  20. * X and Y pos (???)
  21. * Priority (Word)
  22. * Volume (Byte)
  23. * Options (Byte)
  24.   * Bit 0-3: Type:      0=Ambient Pitch Random
  25.                               1-4=Ambient Pitch 1-4
  26.                               5=Spot Pitch Random
  27.                               6-9=Spot Pitch 1-4
  28.   * Bit 4: Repeat
  29.   * Bit 5: Priority Decay
  30. Then you get back a long that is the ID of the sound that later on is used 
  31. if you want to
  32. move the X and Y, or stop the sample.
  33.  
  34. Douglas also wrote:
  35. <Again, no problem with 12.25khz - but remember that we need adjustable
  36. <frequency playback so we can 'turbulate' monster noises. This way we can
  37. <avoid deja-vu with repeated grunts & gunfire at the same pitch.
  38. <
  39. <Doom gets round this horrible effect by playing each sample at a random
  40. <frequency based around a fixed pitch of (around) 9khz.
  41.  
  42. Currently I have four diferent pitches:
  43. 12.55KHz, 10.98KHz, 9.41KHz and 7.84KHz
  44. I did not get the "(around) 9khz" thing, but after trying around in some 
  45. trackers I thinks this will not sound to bad. And dont worry about the 
  46. speed,   At first I thougth pitch would slow down. But with theese numbers 
  47. it turned out that it takes less time the more I pitch down from 12.5KHz.
  48.  
  49. More Douglas quote:
  50. <200k of code - are you considering code generation? Remember this will not
  51. <cache on the 68030 and 68040 - and tables can suffer in a similar fashion due
  52.  
  53. Nope not such as much code.  The size of the actual code loops depends on 
  54. how to pitch the sample and 16Bits or 8Bits replay and if it is ambient 
  55. sounds. The worst case loop end up at 262Bytes. That is No pitch 16Bit 
  56. 6.25KHz sample, interleaved and spot sound only.  Only changing to Non Inter 
  57. leaved will reduse this to 246. Pitches sound decrease even more, not to 
  58. mention silence!! :-)
  59. But the tables will be quite huge!
  60. 16Bit, DDAdio (3D sound),  will take up more then 250K!!!
  61. Now I calculate the 3D sound in 256 degrees around the player, halving 
  62. theese steps will halve the size of the table. SubStation uses 16 or 32 
  63. degrees. So 256 seems to be pointless. But I think I will make it as an 
  64. aption of: 32, 64, 128 or 256 degrees.  Having 8Bit replay will also halve 
  65. the size. And Only calculating Mono (Distance only) will take the tables 
  66. away nearly completely!
  67. Therefor I ask if it is possible to allocate memory for theese buffers while 
  68. playing, or will this make troubles with the cashe routines for the 
  69. textures???   I would want to be able to not only alloctae memmory whenever 
  70. I want to. I do also want to change the size of my allocated memory whenever 
  71. I want to.!  Is this possible???
  72.  
  73. Douglas do also says that some kind of envelope of the sound is wanted. 
  74. Personaly I cant se why. Dont you fixx those things when you sample the 
  75. sounds in the first place? I might be wrong but is this realy needed???   It 
  76. wont take any extra processor power, just need some few more tables. But 
  77. still are they needed? Do PC doom use envelopes for the sound fx?
  78.  
  79. Further more the sound need to be cashed just as the textures. To bad but 
  80. all sounds dont fit in normal memory. So I would want to reuse the cashe 
  81. routines for the textures. Or maybe the same routines could be used? This is 
  82. not urgent right now, but it would be best if I could get  look and 
  83. description of that piece of code in time :-) (Dont have a clue about how a 
  84. cashe could be coded in a easy way)
  85.  
  86. And last but not least:   clock cykles!   I have a clock cykle table for 030 
  87. in a file called 68030.TXT, this does not make much sence, and dont seem to 
  88. be very correct as I could see...   So there for I ask for a new timing 
  89. table. Or someone just could tell me how many cykles the following commands 
  90. take:
  91. _12KHzA     move.b    (a0)+,d3
  92. _6KHzA                  move.w    (a0)+,d3
  93.                   and.w    d2,d3
  94. _12KHzAP    move.b    (a0),d3
  95. _6KHzAP    move.w    (a0),d3
  96.                   and.w    d2,d3
  97. _16BitDDA    move.b    (a2,d3.w),d3
  98.                   move.l    (a4,d3.w*4),d7
  99. _16BitDA            move.w    (a2,d3.w*2),d7
  100. _8BitDDA    move.b    (a2,d3.w),d3
  101.                   move.w    (a4,d3.w*2),d7
  102. _8BitDA                  move.b    (a2,d3.w),d7
  103. _16BitDDAA    move.l    (a2,d3.w*4),d7
  104. _8BitDDAA    move.w    (a2,d3.w*2),d7
  105. _8BitDAA    move.b    (a2,d3.w),d7
  106. _16BitDDSA    move.l    d1,d7
  107. _16BitDSA    move.w    d1,d7
  108. _8BitDSA    move.b    d1,d7
  109. _16BitDDa    add.l    d6,d7
  110. _16BitDa                  add.w    d6,d7
  111. _8BitDa                  add.b    d6,d7
  112. _16BitDD                  move.l    d7,(a6)+
  113. _16BitD                  move.w    d7,(a6)+
  114. _8BitD                  move.b    d7,(a6)+
  115. _16BitDDadd    add.l    d7,(a6)+
  116. _16BitDadd    add.w    d7,(a6)+
  117. _8BitDadd    add.b    d7,(a6)+
  118. _16Bit8ChDDIL      lea    12(a6),a6
  119. _16Bit8ChDIL        addq.l    #6,a6
  120. _CSound    dbra    d0,_CSound
  121. _SoundReady    rts
  122. Hmm, seems like a lot of commands, but some of them are repeated I think. 
  123. Could someone please just check out the timing for cash hits and non-hits 
  124. for al of theese and I will be very happy!   And then I would like to know 
  125. how many clock cykles you aproximatly have each VBL.   If I am to believe 
  126. the timing table I now have it now take about 2% for the lowest sound 
  127. quality and 20% for the highest. Dont belive in this though!
  128. The % taken do also depends on how many channels used, and if the sounds are 
  129. ambient or not.
  130.  
  131. Seting up the quality now have 5 things that changes the CPU needed. They are:
  132. 16Bit / 8Bit  calculation
  133. 12.25KHz / 6.12KHz calculation
  134. DDAudio / DAudio
  135. 8 / 4 Channels
  136. Non Interleaved / Interleaved
  137. Left of "/" sound better but takes more power. No combination is illegal so 
  138. 32 different quality setting are possible!!!
  139.  
  140. Oh, one last thing!   May I use FPU commands???
  141. I need Square root and arc-sine for the DD Audio calculation...
  142.  
  143. mvh
  144.         PeyloW of T.O.Y.S.
  145.  
  146.  
  147.